{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('admin/goods/index')}">商品列表</a></li>
            <li class="layui-this">编辑商品</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('admin/goods/update')}" method="post">
                    {:token()}
                    <input type="hidden" name="id" value="{$goods_info.goods_id}">

                    <div class="layui-form-item">
                        <label class="layui-form-label">商品名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="goods_name" value="{$goods_info.goods_name}" required lay-verify="required"
                                   placeholder="请输入商品名称(限制12字)" class="layui-input">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">起拍价格</label>
                        <div class="layui-input-block">
                            <input type="text" name="start_price" value="{$goods_info.start_price}" required lay-verify="required"
                                   placeholder="请输入起拍价格" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">加价幅度</label>
                        <div class="layui-input-block">
                            <input type="text" name="raise_price" value="{$goods_info.raise_price}" required lay-verify="required"
                                   placeholder="请输入加价幅度" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">市场价</label>
                        <div class="layui-input-block">
                            <input type="text" name="market_price" value="{$goods_info.market_price}" required lay-verify="required"
                                   placeholder="请输入市场价" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">本店价</label>
                        <div class="layui-input-block">
                            <input type="text" name="shop_price" value="{$goods_info.shop_price}" required lay-verify="required"
                                   placeholder="请输入本店价" class="layui-input">
                        </div>
                    </div>






                    <div class="layui-form-item">
                        <label class="layui-form-label">详细介绍</label>
                        <div class="layui-input-block">
                            <input type="file" multiple="" name="" class="upimg_other">
                            <div class="img-url-box_other"></div>
                            <div class="img-box_other">
                                {foreach $goods_info.img_arr_info as $k=>$vo}
                                <li class="img-upload-url">
                                    <img src="{$vo}"
                                         alt=""
                                         data-value="{$vo}"
                                         class="img-url storeBanner">
                                    <div class="delImg" data-content-id="{$k}">×</div>
                                </li>
                                {/foreach}
                            </div>
                        </div>

                        <input type="hidden" name="cover_arr_other"
                               value="{$goods_info.detail_img}"

                               id="cover_arr_other">
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">竞拍结束时间</label>
                        <div class="layui-input-inline">
                            <input class="layui-input" id="date" placeholder="yyyy-MM-dd HH:mm:ss" name="end_time" value="{$goods_info.sales_end_time|date='Y-m-d H:i:s',###}" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"><!--{php} echo date('Y-m-d H:i:s',time());{/php}-->
                        </div>
                    </div>

                    <div class="layui-form-item" id="online_time_status">
                        <label class="layui-form-label">显示设置</label>
                        <div class="layui-input-block">
                            <input type="radio" name="is_on_sale" value="0" title="下线"  {if	condition="$goods_info.is_on_sale==0"} checked="checked"  {/if} >
                            <input type="radio" name="is_on_sale" value="1" title="上线" {if	condition="$goods_info.is_on_sale==1"} checked="checked"  {/if} >
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">内容</label>
                        <div class="layui-input-block">
                            <textarea name="content" lay-verify="content" placeholder="" class="layui-textarea" id="content">{$goods_info.goods_content}</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="">保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script src="__JS__/ueditor/ueditor.config.js"></script>
<script src="__JS__/ueditor/ueditor.all.min.js"></script>
{/block}
{block name="script"}
<script>

    $(function() {
        var ue = UE.getEditor('content'),
                uploadEditor = UE.getEditor('upload-photo-btn'),
                photoListItem,
                uploadImage;

        uploadEditor.ready(function () {
            uploadEditor.setDisabled();
            uploadEditor.hide();
        });

    });

//    synchrobulid();
    $(function() {
        layui.upload({
            url: "/api/file_upload/upload",
            success: function (data) {
                if (data.error === 0 && data.type === 'image') {
                    document.getElementById('img_url').value = data.url;
                    var _ad_index_img_box = $(".ad_index_img_box");//上传图片显示盒子
                    _ad_index_img_box.empty();
                    _ad_index_img_box.append(
                            '<img style="display: block; width: 92px;" src="' + data.url + '"/>'
                    );
                } else {
                    layer.msg(data.message);
                }
            }
        });

        $('.date').on('click', function () {
            laydate({
                elem: this
                ,format: 'YYYY-MM-DD hh:mm:ss'
                ,type: 'datetime'
            })
        });
    });

</script>


{/block}